package com.kk.dao;

import com.kk.model.RoleMenuRel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author: kevin
 * @date: 2018-10-14 19:16
 */
public interface RoleMenuRelDao extends JpaRepository<RoleMenuRel, String> {

    @Query("select r from RoleMenuRel r where r.role.id=?1 and r.menu.level=1")
    List<RoleMenuRel> findTopMenusByRoleId(String roleId);

}
